package com.linkhub.oms.data.sync.api.yunexpress.domain.request;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @Description: 运单申请请求参数
 * @Author: Jaycle
 * @Date: 2024/67/5 16:41
 * @Version: 1.0
 */
@Data
public class CreateOrderRequest implements Serializable {

    @JSONField(name = "CustomerOrderNumber")
    private String CustomerOrderNumber;

    @JSONField(name = "ShippingMethodCode")
    private String ShippingMethodCode;

    @JSONField(name = "TrackingNumber")
    private String TrackingNumber;

    @JSONField(name = "TransactionNumber")
    private String TransactionNumber;

    @JSONField(name = "IossCode")
    private String IossCode;

    @JSONField(name = "BrazilianCode")
    private String BrazilianCode;

    @JSONField(name = "SizeUnits")
    private String SizeUnits;

    @JSONField(name = "Height")
    private Integer Height;

    @JSONField(name = "Length")
    private Integer Length;

    @JSONField(name = "Width")
    private Integer Width;

    @JSONField(name = "PackageCount")
    private int PackageCount;

    @JSONField(name = "Weight")
    private BigDecimal Weight;

    @JSONField(name = "ApplicationType")
    private Integer ApplicationType;

    @JSONField(name = "ReturnOption")
    private Integer ReturnOption;

    @JSONField(name = "TariffPrepay")
    private Integer TariffPrepay;

    @JSONField(name = "InsuranceOption")
    private Integer InsuranceOption;

    @JSONField(name = "SourceCode")
    private String SourceCode;

    @JSONField(name = "Receiver")
    private ReceiverInfo Receiver;

    @JSONField(name = "Sender")
    private SenderInfo Sender;

    @JSONField(name = "OrderExtra")
    private List<OrderExtraInfo> OrderExtra;

    @JSONField(name = "Parcels")
    private List<ParcelInfo> Parcels;

    @JSONField(name = "ChildOrders")
    private List<ChildOrderInfo> ChildOrders;

    @Data
    public static class ReceiverInfo implements Serializable {

        @JSONField(name = "CountryCode")
        private String CountryCode;

        @JSONField(name = "FirstName")
        private String FirstName;

        @JSONField(name = "LastName")
        private String LastName;

        @JSONField(name = "Company")
        private String Company;

        @JSONField(name = "Street")
        private String Street;

        @JSONField(name = "City")
        private String City;

        @JSONField(name = "State")
        private String State;

        @JSONField(name = "Zip")
        private String Zip;

        @JSONField(name = "Phone")
        private String Phone;

        @JSONField(name = "HouseNumber")
        private String HouseNumber;

        @JSONField(name = "Email")
        private String Email;
    }

    @Data
    public static class SenderInfo implements Serializable {

        @JSONField(name = "CountryCode")
        private String CountryCode;

        @JSONField(name = "FirstName")
        private String FirstName;

        @JSONField(name = "LastName")
        private String LastName;

        @JSONField(name = "Company")
        private String Company;

        @JSONField(name = "Street")
        private String Street;

        @JSONField(name = "City")
        private String City;

        @JSONField(name = "State")
        private String State;

        @JSONField(name = "Zip")
        private String Zip;

        @JSONField(name = "Phone")
        private String Phone;

        @JSONField(name = "HouseNumber")
        private String HouseNumber;
    }

    @Data
    public static class OrderExtraInfo implements Serializable {

        @JSONField(name = "ExtraCode")
        private String ExtraCode;

        @JSONField(name = "ExtraName")
        private String ExtraName;
    }

    @Data
    public static class ParcelInfo implements Serializable {

        @JSONField(name = "EName")
        private String EName;

        @JSONField(name = "CName")
        private String CName;

        @JSONField(name = "HSCode")
        private String HSCode;

        @JSONField(name = "Quantity")
        private int Quantity;

        @JSONField(name = "SKU")
        private String SKU;

        @JSONField(name = "UnitPrice")
        private BigDecimal UnitPrice;

        @JSONField(name = "UnitWeight")
        private BigDecimal UnitWeight;

        @JSONField(name = "Remark")
        private String Remark;

        @JSONField(name = "InvoiceRemark")
        private String InvoiceRemark;

        @JSONField(name = "CurrencyCode")
        private String CurrencyCode;
    }

    @Data
    public static class ChildOrderInfo implements Serializable {

        @JSONField(name = "BoxNumber")
        private String BoxNumber;

        @JSONField(name = "Length")
        private int Length;

        @JSONField(name = "Width")
        private int Width;

        @JSONField(name = "Height")
        private int Height;

        @JSONField(name = "BoxWeight")
        private double BoxWeight;

        @JSONField(name = "ChildDetails")
        private List<ChildDetailInfo> ChildDetails;

        @Data
        public static class ChildDetailInfo implements Serializable {

            @JSONField(name = "Sku")
            private String Sku;

            @JSONField(name = "Quantity")
            private int Quantity;
        }
    }
}
